*Graph Settings
grstyle clear
set scheme s2color
grstyle init
grstyle set plain, box
grstyle color background white
grstyle set color Set1
grstyle yesno draw_major_hgrid yes
grstyle yesno draw_major_ygrid yes
grstyle color major_grid gs8
grstyle linepattern major_grid dot
grstyle set legend 4, box inside
grstyle color ci_area gs12%50


******Main Models******
**Model 1a
reghdfe Nonpartisanship AveragePartisanship NetworkSize AverageEducation EthnicHomophily AverageCommunity Q28 AGE Gender i.Religion i.Ethnicity2 i.Urban [pw=pweights], cluster (Village_Neighborhood DoubleSample) noabsorb
**Model 1b
reghdfe Nonpartisanship AveragePartisanship Education SES_Factor Q76a Q85a Q86a Q107 Q79a Q28 AGE Gender i.Religion i.Ethnicity2 i.Urban [pw=pweights], cluster (Village_Neighborhood DoubleSample) noabsorb
***Model 1c
reghdfe Nonpartisanship AveragePartisanship NetworkSize AverageEducation EthnicHomophily AverageCommunity Education SES_Factor Q76a Q85a Q86a Q107 Q79a Q28 AGE Gender i.Religion i.Ethnicity2 i.Urban [pw=pweights], cluster (Village_Neighborhood DoubleSample) noabsorb
margins, at(AveragePartisanship=(0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1))
marginsplot, recast(line) plot1opts(lcolor(gs8)) ciopt(color(black%20)) recastci(rarea) xtitle("Percentage of Network that Feels Close to a Party") ytitle("Pr(Individual Feels Close to a Party)") yscale(range(0.1 0.8)) ylabel(0.1(.1)0.8) addplot(hist AveragePartisanship, percent yaxis(2) legend(off))

**Model 2a
reghdfe OppositionPartisan AverageOpposition1 NetworkSize AverageEducation EthnicHomophily AverageCommunity Q28 AGE Gender i.Religion i.Ethnicity2 i.Urban [pw=pweights], cluster (Village_Neighborhood DoubleSample) noabsorb
**Model 2b
reghdfe OppositionPartisan AverageOpposition1 Education SES_Factor Q76a Q85a Q86a Q107 Q79a Q28 AGE Gender i.Religion i.Ethnicity2 i.Urban [pw=pweights], cluster (Village_Neighborhood DoubleSample) noabsorb
**Model 2c
reghdfe OppositionPartisan AverageOpposition1 NetworkSize AverageEducation EthnicHomophily AverageCommunity Education SES_Factor Q76a Q85a Q86a Q107 Q79a Q28 AGE Gender i.Religion i.Ethnicity2 i.Urban [pw=pweights], cluster (Village_Neighborhood DoubleSample) noabsorb
margins, at(AverageOpposition1=(0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1))
marginsplot, recast(line) plot1opts(lcolor(gs8)) ciopt(color(black%20)) recastci(rarea) xtitle("Percentage of Network that Feels Close to an Opp Party") ytitle("Pr(Individual Feels Close to an Opp Party)") yscale(range(0.1 0.8)) ylabel(0.1(.1)0.8) addplot(hist AverageOpposition, percent yaxis(2) legend(off))
marginsplot, recast(line) plot1opts(lcolor(gs8)) ciopt(color(black%20)) recastci(rarea) xtitle("Percentage of Network that Feels Close to an Opp Party") ytitle("Pr(Individual Feels Close to an Opp Party)") yscale(range(0.1 0.8)) ylabel(0.1(.1)0.8) addplot(hist AverageOpposition, percent yaxis(2) legend(off))

**Model 3
reghdfe OppositionPartisan I_1_Q70l2 I_1_Q70b I_1_Q70c_coethnic I_1_Q70j Education SES_Factor Q76a Q85a Q86a Q107 Q79a Q28 AGE Gender i.Religion i.Ethnicity2 i.Urban if I_1_Q70a_prepartisan==1 [pw=pweights], cluster (Village_Neighborhood DoubleSample) noabsorb
margins, at(I_1_Q70l2=(0 1))
marginsplot, recast(scatter) plot1opts(lcolor(gs8) mcolor(black)) ciopt(color(black%50)) subtitle("Only Discussion Partners Who Predate Partisanship") xtitle("Discussion Partner Feels Close to an Opp Party") ytitle("Pr(Individual Feels Close to an Opp Party)") yscale(range(0.1 0.8)) ylabel(0.1(.1)0.8) xlabel(0 "No" 1 "Yes") xscale(range(-0.5 1.5))



*************Appendix E
**Model 1a
reghdfe Nonpartisanship AveragePartisanship NetworkSize AverageEducation EthnicHomophily AverageCommunity Q28 AGE Gender i.Religion i.Ethnicity2 i.Urban [pw=pweights] if NetworkSize>1, cluster (Village_Neighborhood DoubleSample) noabsorb
**Model 1b
reghdfe Nonpartisanship AveragePartisanship Education SES_Factor Q76a Q85a Q86a Q107 Q79a Q28 AGE Gender i.Religion i.Ethnicity2 i.Urban [pw=pweights] if NetworkSize>1, cluster (Village_Neighborhood DoubleSample) noabsorb
***Model 1c
reghdfe Nonpartisanship AveragePartisanship NetworkSize AverageEducation EthnicHomophily AverageCommunity Education SES_Factor Q76a Q85a Q86a Q107 Q79a Q28 AGE Gender i.Religion i.Ethnicity2 i.Urban [pw=pweights] if NetworkSize>1, cluster (Village_Neighborhood DoubleSample) noabsorb


**Model 2a
reghdfe OppositionPartisan AverageOpposition1 NetworkSize AverageEducation EthnicHomophily AverageCommunity Q28 AGE Gender i.Religion i.Ethnicity2 i.Urban [pw=pweights] if NetworkSize>1, cluster (Village_Neighborhood DoubleSample) noabsorb
**Model 2b
reghdfe OppositionPartisan AverageOpposition1 Education SES_Factor Q76a Q85a Q86a Q107 Q79a Q28 AGE Gender i.Religion i.Ethnicity2 i.Urban [pw=pweights] if NetworkSize>1, cluster (Village_Neighborhood DoubleSample) noabsorb
**Model 2c
reghdfe OppositionPartisan AverageOpposition1 NetworkSize AverageEducation EthnicHomophily AverageCommunity Education SES_Factor Q76a Q85a Q86a Q107 Q79a Q28 AGE Gender i.Religion i.Ethnicity2 i.Urban [pw=pweights] if NetworkSize>1, cluster (Village_Neighborhood DoubleSample) noabsorb


*************Appendix F
**Table F.1: Covariates of Self-Selection into Network Responses
gen Network_Response=1
replace Network_Response=0 if I_1_Q70d==.

ttest Gender, by(Network_Response)
ttest AGE, by(Network_Response)
ttest Education, by(Network_Response)
ttest SES_Factor, by(Network_Response)
ttest Q28, by(Network_Response)
ttest Nonpartisanship, by(Network_Response)
ttest OppositionPartisan1, by(Network_Response)


*************Appendix G
replace NetworkSize=. if NetworkSize==0
gen Bafia=.
replace Bafia=0 if Ethnicity2>1
replace Bafia=1 if Ethnicity2==1
replace Bafia=. if Ethnicity2==.
gen Bamileke=.
replace Bamileke=0 if Ethnicity2==1 | Ethnicity2>5
replace Bamileke=1 if Ethnicity2==5
replace Bamileke=. if Ethnicity2==.
gen Bamoun=.
replace Bamoun=0 if Ethnicity2<6 | Ethnicity2>6
replace Bamoun=1 if Ethnicity2==6
replace Bamoun=. if Ethnicity2==.
gen Bassa=.
replace Bassa=0 if Ethnicity2<8 | Ethnicity2>8
replace Bassa=1 if Ethnicity2==8
replace Bassa=. if Ethnicity2==.
gen Batanga=.
replace Batanga=0 if Ethnicity2<9 | Ethnicity2>9
replace Batanga=1 if Ethnicity2==9
replace Batanga=. if Ethnicity2==.
gen BetiFang=.
replace BetiFang=0 if Ethnicity2<11 | Ethnicity2>11
replace BetiFang=1 if Ethnicity2==11
replace BetiFang=. if Ethnicity2==.
gen Bulu=.
replace Bulu=0 if Ethnicity2<12 | Ethnicity2>12
replace Bulu=1 if Ethnicity2==12
replace Bulu=. if Ethnicity2==.
gen Dibom=.
replace Dibom=0 if Ethnicity2<13 | Ethnicity2>13
replace Dibom=1 if Ethnicity2==13
replace Dibom=. if Ethnicity2==.
gen Duala=.
replace Duala=0 if Ethnicity2<14 | Ethnicity2>14
replace Duala=1 if Ethnicity2==14
replace Duala=. if Ethnicity2==.
gen Eton=.
replace Eton=0 if Ethnicity2<15 | Ethnicity2>15
replace Eton=1 if Ethnicity2==15
replace Eton=. if Ethnicity2==.
gen Ewondo=.
replace Ewondo=0 if Ethnicity2<16 | Ethnicity2>16
replace Ewondo=1 if Ethnicity2==16
replace Ewondo=. if Ethnicity2==.
gen Mbamois=.
replace Mbamois=0 if Ethnicity2<22 | Ethnicity2>22
replace Mbamois=1 if Ethnicity2==22
replace Mbamois=. if Ethnicity2==.
gen Sawa=.
replace Sawa=0 if Ethnicity2<26 | Ethnicity2>26
replace Sawa=1 if Ethnicity2==26
replace Sawa=. if Ethnicity2==.
gen Other=.
replace Other=0 if Ethnicity2<30 | Ethnicity2>30
replace Other=1 if Ethnicity2==30
replace Other=. if Ethnicity2==.

mi set mlong
mi register imputed OppositionPartisan AverageOpposition1 Nonpartisanship AveragePartisanship NetworkSize AverageEducation EthnicHomophily AverageCommunity Education SES_Factor Q76a Q85a Q86a Q107 Q79a Q28 AGE Gender Religion Bamileke Bamoun Bassa Batanga BetiFang Bulu Dibom Duala Eton Ewondo Mbamois Sawa Other Urban Village_Neighborhood
mi impute mvn OppositionPartisan AverageOpposition1 Nonpartisanship AveragePartisanship NetworkSize AverageEducation EthnicHomophily AverageCommunity Education SES_Factor Q76a Q85a Q86a Q107 Q79a Q28 Bamileke Bamoun Bassa Batanga BetiFang Bulu Dibom Duala Eton Ewondo Mbamois Sawa Other = AGE Gender Religion  Urban Village_Neighborhood, add(50) rseed (53421)

**Model 1a
mi estimate: reg Nonpartisanship AveragePartisanship NetworkSize AverageEducation EthnicHomophily AverageCommunity Q28 AGE Gender i.Religion  Bamileke Bamoun Bassa Batanga BetiFang Bulu Dibom Duala Eton Ewondo Mbamois Sawa Other i.Urban, cluster (Village_Neighborhood) 
**Model 1b
mi estimate: reg Nonpartisanship AveragePartisanship Education SES_Factor Q76a Q85a Q86a Q107 Q79a Q28 AGE Gender i.Religion  Bamileke Bamoun Bassa Batanga BetiFang Bulu Dibom Duala Eton Ewondo Mbamois Sawa Other i.Urban, cluster (Village_Neighborhood)
***Model 1c
mi estimate: reg Nonpartisanship AveragePartisanship NetworkSize AverageEducation EthnicHomophily AverageCommunity Education SES_Factor Q76a Q85a Q86a Q107 Q79a Q28 AGE Gender i.Religion Bamileke Bamoun Bassa Batanga BetiFang Bulu Dibom Duala Eton Ewondo Mbamois Sawa Other i.Urban [pw=pweights], cluster (Village_Neighborhood)

**Model 2a
mi estimate: reg OppositionPartisan AverageOpposition1 NetworkSize AverageEducation EthnicHomophily AverageCommunity Q28 AGE Gender i.Religion Bamileke Bamoun Bassa Batanga BetiFang Bulu Dibom Duala Eton Ewondo Mbamois Sawa Other i.Urban [pw=pweights], cluster (Village_Neighborhood)
**Model 2b
mi estimate: reg OppositionPartisan AverageOpposition1 Education SES_Factor Q76a Q85a Q86a Q107 Q79a Q28 AGE Gender i.Religion Bamileke Bamoun Bassa Batanga BetiFang Bulu Dibom Duala Eton Ewondo Mbamois Sawa Other i.Urban [pw=pweights], cluster (Village_Neighborhood)
**Model 2c
mi estimate: reg OppositionPartisan AverageOpposition1 NetworkSize AverageEducation EthnicHomophily AverageCommunity Education SES_Factor Q76a Q85a Q86a Q107 Q79a Q28 AGE Gender i.Religion Bamileke Bamoun Bassa Batanga BetiFang Bulu Dibom Duala Eton Ewondo Mbamois Sawa Other i.Urban [pw=pweights], cluster (Village_Neighborhood)





